<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        let obj = {
            name: "张三",
            info: {
                age: 20
            },
            nul: null,
            und: undefined,
            fn: () => {
                console.log(123)
            }
        }

        // 深拷贝
        // ...   只是对第一层的基本类型实现深拷贝
        // let obj2 = { ...obj, info: { ...obj.info } }  

        // obj.name = "李四"
        // obj.info.age = 30

        // undefined   function   
        // let obj2 = JSON.parse(JSON.stringify(obj))

        // obj.name = "李四"
        // obj.info.age = 30

        // console.log(obj)
        // console.log(obj2)


        

    </script>
</body>

</html>